package org.apache.ocean.main.util;

import java.util.Map;
import java.util.concurrent.ConcurrentSkipListMap;

public class OceanSkipList<K,V> extends ConcurrentSkipListMap<K,V> {
  public OceanSkipList() {
    super();  	
  }
  
  public V firstValue() {
  	Map.Entry<K, V> entry = firstEntry();
  	if (entry == null) return null;
  	return entry.getValue();
  }
  
  public V lastValue() {
  	Map.Entry<K, V> entry = lastEntry();
  	if (entry == null) return null;
  	return entry.getValue();
  }
  
  public V getGreaterOrEqualTo(K fromKey) {
  	Map.Entry<K,V> entry = ceilingEntry(fromKey);
  	if (entry == null) return null;
  	return entry.getValue();
  }
}
